<HTML><HEAD><TITLE>statsample_control(+ProfileName, +State)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(instprofile)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>statsample_control(+ProfileName, +State)</H1>
Enable / disable the sampling profiler for a named profile.
<DL>
<DT><EM>ProfileName</EM></DT>
<DD>Atom or string
</DD>
<DT><EM>State</EM></DT>
<DD>Atoms 'on' or 'off'
</DD>
</DL>
<H2>Description</H2>
<P>    
   For the named profile, ProfileName, enable or disable the sampling
   profiler based on the value of State. Setting State to 'on' immediately
   enables sample collection at the inteval and to to the file specified in
   statsample/4.
   </P><P>
   For performance reasons, the results are written to File (specified by
   statsample/4) using buffered I/O - each result is not flushed to disk as
   it is written. As a result to ensure all results are flushed to the file,
   <TT>statsample_control(ProfileName, off)</TT> must be executed before
   the results file can be analysed.
   </P>
<H3>Fail Conditions</H3>
Profilename is not a valid profile defined by statsample/4.State is neither the atom 'on' nor the atom 'off'.
<H3>Resatisfiable</H3>
no
<H2>Examples</H2>
<PRE>
   [eclipse 2]: instprofile:statsample_control(memory, on).

   Yes (0.00s cpu)
   [eclipse 3]: ...

   Yes (10.24s cpu)
   [eclipse 4]: instprofile:statsample_control(memory, off).

   Yes (0.00s cpu)
        </PRE>
<H2>See Also</H2>
<A HREF="../../lib/instprofile/statsample-4.html">statsample / 4</A>, <A HREF="../../kernel/env/statistics-2.html">statistics / 2</A>, <A HREF="../../lib/instprofile/index.html">library(instprofile)</A>
</BODY></HTML>
